<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['系统配置','限制进厂配置']" icon="fa fa-cog" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>限制进厂配置</h2>
                </header>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn">
								<sa-company-tree-car companyTreeId="companyTree" wrapId="content" [isShowCarSort]="false" [isShowCarNum]="false" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">进厂状态</span>
									<select name="" class="top_module_select" [(ngModel)]="state">
										<option value="">全部</option>
										<option value="1">已限制进厂记录</option>
										<option value="2">全部记录</option>
									</select>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">是否启用</span>
									<select name="" class="top_module_select" [(ngModel)]="isOpen">
										<option value="">全部</option>
										<option value="0">不启用</option>
										<option value="1">启用</option>
									</select>
								</div>
                                <button type="button" class="btn btn-primary" (click)="tableSearch()">查询</button>
                                <button type="button" class="btn btn-primary" (click)="showAddLimitModal(limitEntryModal)">添加</button>
                                <!-- <button type="button" class="btn btn-primary" (click)="showImportModal(weightModal)">批量导入</button> -->
                                <!-- <button type="button" class="btn btn-primary" (click)="exportData()">导出</button> -->
                            </div>
                            <!-- <div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="tableSearch()" class="search-input" placeholder="车牌号、公司名称、设备ID">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
								</span>
							</div> -->
                        </div>
                        <div class="table_scroll">
                            <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                <thead>
                                    <tr>
                                        <th>公司名称</th>
                                        <th>浮动范围[0-N]</th>
                                        <th>最大总数[30天]</th>
                                        <th>最大总数[每天]</th>
                                        <th>最大记录数[每车30天]</th>
                                        <th>最大记录数[每车每天]</th>
                                        <th>主机问题数[每车每天]</th>
                                        <th>GPS问题数[每车每天]</th>
                                        <th>传感器问题数[每车每天]</th>
                                        <th>限于已限制进厂记录</th>
                                        <th>是否启用</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let row of tableData" [ngClass]='{selected: activeSelected === row.id }'>
                                        <td>{{row.companyName}}</td>
                                        <td>{{row.floatingRangeStr}}</td>
                                        <td>{{row.maxTotalMonth*1+row.floatingValue*1}}</td>
                                        <td>{{row.maxTotalDay*1+row.floatingValue*1}}</td>
                                        <td>{{row.maxCarMonth}}</td>
                                        <td>{{row.maxCarDay}}</td>
                                        <td>{{row.maxCarHostDay}}</td>
                                        <td>{{row.maxCarGpsDay}}</td>
                                        <td>{{row.maxCarSensorDay}}</td>
                                        <td>{{row.state==1?'已限制进厂记录':'全部记录'}}</td>
                                        <td>{{row.isOpen==0?'不启用':'启用'}}</td>
                                        <!-- 这里也根据权限 -->
                                        <td>
                                            <button type="button" (click)="editRow(row,limitEntryModal)">编辑</button>
                                            <button *ngIf="isShowDelete" type="button" (click)="del_domCode(row)">删除</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-fix clearfix">
                            <paginator [totalRecords]="totalCounts" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                            </paginator>
                            <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>
</div>

<!-- 新增限制进厂配置 -->
<section bsModal #limitEntryModal="bs-modal" class="modal fade addRenewal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width: 670px;">
            <div class="modal-header">
                <button type="button" class="close" (click)="closeLimitEntryModal(limitEntryModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">{{formType=="add"?'新增':'编辑'}}限制进厂配置</h4>
            </div>
            <div class="modal-body">
                <form id="limitEntry" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
                    <div class="row form-horizontal">

                        <div class="form-group clearfix">
                            <label class="control-label col-md-3 col-sm-3 no-padding-right">公司名称<sup>*</sup></label>
                            <div class="col-sm-9">
                                <input class="form-control none" id="selectedCompanyName3" name="selectedCompanyName3" [(ngModel)]="limitEntryObj.companyName"/>
                                <sa-company-tree [Height]="32" [companyNameValue]="selectedCompanyName3" [companyIdValue]="selectedCompanyId3" companyTreeId="companyTree7" (companySelected)="factorySelected($event)"></sa-company-tree>
                            </div>
                        </div>

                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">浮动范围[0-N]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="floatingRange" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.floatingRange'  placeholder="填写浮动范围[0-N]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">最大总数[30天]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="maxTotalMonth" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.maxTotalMonth' placeholder="填写最大总数[30天]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">最大总数[每天]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="maxTotalDay" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.maxTotalDay' placeholder="填写最大总数[每天]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">最大记录数[每车30天]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="maxCarMonth" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.maxCarMonth' placeholder="填写最大记录数[每车30天]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">最大记录数[每车每天]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="maxCarDay" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.maxCarDay' placeholder="填写最大记录数[每车每天]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">主机问题数[每车每天]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="maxCarHostDay" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.maxCarHostDay' placeholder="填写主机问题[每车每天]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">GPS问题数[每车每天]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="maxCarGpsDay" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.maxCarGpsDay' placeholder="填写GPS问题[每车每天]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">传感器问题数[每车每天]<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="maxCarSensorDay" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.maxCarSensorDay' placeholder="填写传感器问题[每车每天]" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">限于已限制进厂记录</label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <label class="col-sm-4"><input type="radio" class="radioSales" name="state" value="0" (click)="clickRecord(1)" style="margin-right:10px" [checked]="!isLimit" />限制进厂记录</label>
                                    <label class="col-sm-4"><input type="radio" class="radioSales" name="state" value="1" (click)="clickRecord(2)" style="margin-right: 10px" [checked]="isLimit" />全部记录</label>
                                    <!-- <input class="form-control" name="state" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.state' placeholder="填写限于已限制进厂记录" /> -->
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">是否启用</label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <label class="col-sm-4"><input type="radio" class="radioSales" name="isOpen" value="1" (click)="clickCheck(1)" style="margin-right: 10px" [checked]="isCheck" />启用</label>
									<label class="col-sm-4"><input type="radio" class="radioSales" name="isOpen" value="0" (click)="clickCheck(0)" style="margin-right:10px" [checked]="!isCheck" />不启用</label>
                                    <!-- <input class="form-control" name="isOpen" autocomplete="off" type="text" [(ngModel)]='limitEntryObj.isOpen' placeholder="填写是否启用" /> -->
                                </div>
                            </div>
                        </div>

                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" (click)="closeLimitEntryModal(limitEntryModal)">取消</button>
                <button type="button" class="btn btn-primary" (click)="submitModal(limitEntryModal)">提交</button>
            </div>
        </div>
    </div>
</section>
<!-- 添加续费记录 结束 -->